
exports.__esModule = true;
exports.default = void 0;

const _utils = require('../utils');

const _constant = require('../utils/constant');

const _relation = require('../mixins/relation');

const _createNamespace = (0, _utils.createNamespace)('grid');
const createComponent = _createNamespace[0];
const bem = _createNamespace[1];

const _default = createComponent({
  mixins: [(0, _relation.ParentMixin)('vanGrid')],
  props: {
    square: Boolean,
    gutter: [Number, String],
    iconSize: [Number, String],
    clickable: Boolean,
    columnNum: {
      type: [Number, String],
      default: 4,
    },
    center: {
      type: Boolean,
      default: true,
    },
    border: {
      type: Boolean,
      default: true,
    },
  },
  computed: {
    style: function style() {
      const { gutter } = this;

      if (gutter) {
        return {
          paddingLeft: (0, _utils.addUnit)(gutter),
        };
      }
    },
  },
  render: function render() {
    let _ref;

    const h = arguments[0];
    return h('div', {
      style: this.style,
      class: [bem(), (_ref = {}, _ref[_constant.BORDER_TOP] = this.border && !this.gutter, _ref)],
    }, [this.slots()]);
  },
});

exports.default = _default;
